package com.zg.scf.constant;

import com.zg.common.core.exception.IException;

/**
 * <p>Description: </p>
 *
 * @author zhanfeng.liang
 * @since 2025/5/21 16:40
 */

public enum ScfE implements IException {

    ACCOUNT_BANK_TYPE_SORT_EXIST(00001, "每一个银行只能有一个默认账户"),
    BANK_ACCOUNT_EXIST(00002, "账号不能重复"),
    PRODUCT_TYPE_IS_NORMAL(10001, "产品类型启用，不能编辑、删除"),
    PRODUCT_TYPE_IS_USED(10002, "产品类型已使用"),
    CREDIT_IS_NORMAL(20001, "授信启用，不能编辑、删除"),
    CREDIT_IS_USED(20002, "授信类型已使用"),
    PRODUCT_IS_NORMAL(30001, "产品启用，不能编辑、删除"),
    PRODUCT_IS_USED(30002, "产品已使用"),

    USER_PASSWORD_MISMATCH(40001, "密码和确认密码不一致"),
    USER_USERNAME_TAKEN(40002, "用户名已被使用"),
    USER_PHONE_TAKEN(40003, "手机号已被使用"),
    USER_INVALID_COMPANY(40004, "请选择正确的所属企业"),
    USER_INVALID_USER_TYPE(40005, "请选择正确的用户类型"),
    USER_INVALID_ROLE(40006, "请选择正确的角色"),
    USER_INVALID_USER(40007, "请选择正确的用户"),

    ;

    private Integer code;
    private String msg;

    ScfE(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        String s =ScfConstant.SYS_CODE + String.format("%05d", this.code);
        return  Integer.valueOf(s);
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
